package com.example.vo.resp;

import lombok.Data;

@Data
public class Result {
    private int code;
    private String message;
    private Object data;

    public static Result SUCCESS() {
        Result r = new Result();
        r.setCode(200);
        r.setMessage("请求成功");

        return r;
    }

    public static Result SUCCESS(Object data) {
        Result r = new Result();
        r.setCode(200);
        r.setMessage("请求成功");
        r.setData(data);
        return r;
    }

    public static Result FAILED(Object data) {
        Result r = new Result();
        r.setCode(400);
        r.setMessage("请求失败");
        r.setData(data);

        return r;
    }
}
